package common;

import java.io.Serializable;

public class Item implements Serializable {
	
	private String name;
	private String description;
	private String owner;
	private String currentBidder;
	private double currentBid;
	private int auctionTime;
	
	public Item(String name, String description, String owner, String currentBidder, double currentBid, int auctionTime) {
		this.name = name;
		this.description = description;
		this.owner = owner;
		this.currentBidder = currentBidder;
		this.currentBid = currentBid;
		this.auctionTime = auctionTime;
	}
	
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}
	public String getOwner() {
		return owner;
	}
	public void setOwner(String owner) {
		this.owner = owner;
	}
	public String getCurrentBidder(){
		return this.currentBidder;
	}
	public void setCurrentBidder(String currentBidder){
		this.currentBidder = currentBidder;
	}
	public double getCurrentBid() {
		return currentBid;
	}
	public void setCurrentBid(double currentBid) {
		this.currentBid = currentBid;
	}
	public int getAuctionTime() {
		return auctionTime;
	}
	public void setAuctionTime(int auctionTime) {
		this.auctionTime = auctionTime;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((name == null) ? 0 : name.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Item other = (Item) obj;
		if (name == null) {
			if (other.name != null)
				return false;
		} else if (!name.equals(other.name))
			return false;
		return true;
	}

}
